3.3.6 Property
A
A property list can be
- loaded from the file system or copied to the workspace from the property-list manager;
- created from text input or in the property-list manager;
- manipulated in the workspace by adding and removing expressions.
3.3.6.1 Construction
A property list can be created from text input. The input form of a property list is a comma-separated list of equations and transforms introduced by an = operator and a property-list name. The simplest is an empty property list, given by =name. An example of a one-element property list is =name,a-a=0 and a two element list is =name,a-a=0,a*a=a^2. However, even an expression as simple as last one above is prone to many expression-input errors.
Another way to create property lists is to start with a simple one and add equations and transforms. The interaction for this is the same as for applying a property but with the following difference: the active expression has no selection. In this context, Property is interpreted as an add-to-list action (insertion). If there is more than one property list in the workspace, the target is the last property list activated. If the property-list target has a selection, the active expression is added after that item. More precisely,
- touch a property list to make it active
- ensure no item within the list is selected
- touch an expression to make it active
- ensure no subexpression has been selected
- apply Property
Aside from insertion, the other operation on property lists is
deletion using
. Clearly, the entire list is deleted if it constitutes the entire
selection. However, if the list is active and has a property item
selected, the delete action causes just the property item to be
deleted.
3.3.6.2 Application
Follow these steps to apply a specific property from a property list.
- select an element of a property list
- select a subexpression in any other expression
- apply Property
- the property will be applied if it matches the subexpression
If the selected property can be applied to the subject, the active expression will be transformed using the property. Alternatively, all the properties can be tested to see if one can be applied. To search for a property that can be applied,
- ensure no element of a property list is selected
- select a subexpression in any other expression
- apply Property
If the general search results in one property that matches, the transformation will be applied. Matching properties are gathered from all property lists in the workspace. If more than one matching property is found, you will be prompted with a list of candidate transformations. Pick one to apply it.
For example, a set of useful properties for Boolean expressions is given in Figure 3.3. Now, it is easy to go from
(1)
If no property is selected, the entire list is searched for a matching rule. If more than one rule matches, the candidates will be presented; selecting one of these will transform the expression.
3.3.6.3 Management
The property list manager is invoked by Display Properties (see §8.1.8). The manager's primary function is to support browsing through available property lists and selecting one to be copied into the algebra workspace. The manager can also create and discard property lists, rename them and edit their extended description.
3.3.6.4 Persistence
Property lists can be loaded from the file system by using a merge load. In this scenario, a file with a single property list (or any number of expressions, really) can be loaded or merged into the workspace. See §8.2.1 for a discussion of the merge operation. The general idea is to prepare a property list, remove all other expressions from the workspace, and save the workspace to the file system. Then the file, containing just the property list, can be recovered for later use in any other workspace page. As well, a property list loaded from a file can be added to the persistent collection.
Here is an example showing the format of a property-list file. Within a property element, there must be at most one <name> and <description> element and any number of <rule> elements.
<?xml version='1.0' encoding='UTF-8' standalone='yes' ?> <properties version="3"> <property> <name>reciprocals</name> <description>trignometric identities of the form f(x)=1/g(x)</description> <rule>sin x=1÷csc x</rule> <rule>...</rule> </property> ... </properties>